package top.manbutech.mtools.mtools;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Toast;

import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
import com.qmuiteam.qmui.widget.QMUITopBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends Activity {
    @BindView(R.id.topbar) QMUITopBar mTopBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // 沉浸式状态栏
        QMUIStatusBarHelper.translucent(this);
        View root = LayoutInflater.from(this).inflate(R.layout.activity_main, null);
        ButterKnife.bind(this, root);
        //初始化状态栏
        initTopBar();
        //设置view
        setContentView(root);

    }

    //初始化状态栏
    private void initTopBar() {
        mTopBar.setTitle("工具箱");
    }

    @OnClick({R.id.button_login})
    void onClickButton(View view){
        switch (view.getId()){
            case R.id.button_login:
                onClickLogin(view);
        }
    }

    private void onClickLogin(View view) {
        Toast.makeText(this,"点击了登录",Toast.LENGTH_SHORT).show();
        Intent intent = new Intent(this,AboutActivity.class);
        startActivity(intent);
    }


}
